package indexer

import us.codecraft.webmagic.Request
import us.codecraft.webmagic.Task
import us.codecraft.webmagic.scheduler.component.DuplicateRemover
import java.util.concurrent.atomic.AtomicInteger

class NoopDuplicateRemover() : DuplicateRemover {
    private val counter: AtomicInteger = AtomicInteger(0)
    override fun getTotalRequestsCount(task: Task?): Int {
        return counter.get()
    }

    override fun resetDuplicateCheck(task: Task?) {

    }

    override fun isDuplicate(request: Request?, task: Task?): Boolean {
        counter.incrementAndGet()
        return false
    }

}